<div class="formtitle">
    <span><?php echo $tableTitle; ?></span>
</div>
<?php if (empty($tdList)): ?>
    <h1>查无数据</h1>
<?php else: ?>
    <table class="tablelist" id="dataTable">
        <thead>
            <tr>
                <?php foreach ($thList as $th): ?>
                    <?php if (is_string($th)): ?>
                        <th><?php echo $th; ?></th>
                    <?php else : ?>  
                        <?php if (is_array($th)): ?>
                            <th>
                                <?php echo $th['text']; ?>
                                <?php if (isset($th['order'])): ?>
                                    <i class="sort" data-order="<?php echo $th['order']; ?>">
                                        <img src="/houtai/images/px.gif">
                                    </i> 
                                <?php endif; ?>
                            </th>
                        <?php endif; ?>
                    <?php endif; ?>
                    
                <?php endforeach; ?>
            </tr>
        </thead>
        <tbody>
           <?php foreach ($tdList as $row): ?>
               <tr>
                   <?php foreach ($row as $td): ?>
                    <?php if (is_array($td)): ?>
                        <td <?php echo isset($td['class']) ? 'class="'.$td['class'].'"' : ''; ?>>
                            <?php echo isset($td['val']) ? $td['val'] : ''; ?>
                        </td>
                    <?php else: ?>
                        <td>
                           <?php echo $td; ?> 
                        </td>
                    <?php endif; ?>
                   <?php endforeach; ?>
               </tr>
           <?php endforeach; ?>

        </tbody>
    </table>

<?php endif;//判断:有无数据 ?>